package cn.javass.dp.decorator.example5;

import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
import java.io.FileOutputStream;

public class Client {

    public static void main(String[] args) throws Exception {
   /*     DataOutputStream dout = new DataOutputStream(
                new BufferedOutputStream(
                        new EncryptOutputStream(
                                new FileOutputStream("MyEncrypt.txt")
                        )
                )
        );
        dout.write("abcdef".getBytes());
        dout.close();*/


        DataOutputStream dout = new DataOutputStream(
                new EncryptOutputStream2(
                      new BufferedOutputStream(
                                new FileOutputStream("MyEncrypt.txt")
                        )
                )
        );
        dout.write("bbbb".getBytes());
        dout.close();
    }
}
